#!/bin/bash
#
#针对文件复制情况，检测目录文件差异
n=0
for i in $(find /sh/ -name "file*");do
	sh_file=$(echo "$i" | awk -F / '{print $NF}' )
	sh_jym=$(md5sum $i | awk '{print $1}')
	for j in $(find /bj/ -name "file*");do
		bj_file=$(echo "$j" | awk -F / '{print $NF}')
		bj_jym=$(md5sum $j | awk '{print $1}')
		if [ $sh_file == $bj_file ];then
			let n++
			if [ $sh_jym != $bj_jym ];then
            echo "文件${sh_file}数据顺坏"
            fi
		fi
	done
	if [ $n -eq 1 ];then
		let n--
	else
		echo "文件$i缺失"
	fi
done
